package com.sun.module_category.net

import com.sun.module_base.network.NetworkApi
import com.sun.module_category.model.ParentBean
import com.sun.module_common.config.BASE_URL
import com.sun.module_common.model.Article
import com.sun.module_common.model.ListWrapper
import com.sun.module_network.HttpResult
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

/**
 *@author:sunc
 *@time :2025/7/30 15:56
 *@desc: 描述
 */
interface ApiService {
    companion object {
        fun getInstance(): ApiService {
            return NetworkApi.INSTANCE.getApi(ApiService::class.java, BASE_URL)
        }
    }

    /**
     * 项目分类
     */
    @GET("/project/tree/json")
    suspend fun getProjectCategory(): HttpResult<MutableList<ParentBean>?>

    /**
     * 某项目分类下的列表
     */
    @GET("/project/list/{page}/json")
    suspend fun getCategoryList(
        @Path("page") page: Int,
        @Query("cid") cid: Int
    ): HttpResult<ListWrapper<Article>?>
}